# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header:$

inherit wxwidgets cvs

ECVS_USER="anonymous"
ECVS_SERVER="cvs.sourceforge.net:/cvsroot/wired"
ECVS_MODULE="wired"
ECVS_LOCALNAME="${PN}"
S=${WORKDIR}/${ECVS_LOCALNAME}

IUSE="gtk2 unicode"

DESCRIPTION="A professional music production and creation software"
HOMEPAGE="http://bloodshed.net/wired/?sid=1"
SRC_URI=""

SLOT="0"
LICENSE="GPL-2"
KEYWORDS="~x86"

DEPEND=">=media-libs/portaudio-18.99
	media-libs/libsndfile
	media-libs/libsoundtouch
	>=x11-libs/wxGTK-2.5.0"

src_compile() {
	export WX_GTK_VER="2.6"
	if ! use gtk2; then
		need-wxwidgets gtk
	elif use unicode; then
		need-wxwidgets unicode # Unicode cannot be in wxwidgets for wired
	else
		need-wxwidgets gtk2
	fi

	for i in `find ${WORKDIR}/ -type f` ; do
		cat $i | grep -q "wx-config"
		tmp=$?
		if [ $tmp -eq 0 ]; then
			sed s:wx-config:${wxconfig}:g $i  > ${i}.tmp
			mv ${i}.tmp $i
		fi
	done


	econf || die
	emake || die
}

src_install () {
	make DESTDIR=${D} install || die
}
